package com.xbongbong.pro.businessrule.pojo.dto;

import com.xbongbong.paas.domain.entity.PaasFormDataEntity;
import com.xbongbong.paas.domain.entity.ext.ConditionsEntityExt;
import com.xbongbong.paas.domain.entity.ext.PaasFormDataEntityExt;
import com.xbongbong.paas.field.FieldAttrEntity;
import com.xbongbong.paas.field.FilterConditionsPoJo;
import com.xbongbong.paas.pojo.OperationsPojo;
import com.xbongbong.paas.toolbox.wrap.BaseDTO;
import com.xbongbong.pro.domain.entity.UpdateDataEntity;
import com.xbongbong.pro.enums.businessrule.enums.RuleVersionEnum;
import com.xbongbong.pro.form.pojo.RuleTargetPojo;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.util.List;
import java.util.Map;

/**
 * @author: wufeng
 * @date: 2018/12/29 9:52
 * @desrcption: 生效规则符合过滤条件时，执行操作
 */
@Getter
@Setter
@ToString
public class OperationDTO extends BaseDTO {

    private static final long serialVersionUID = -2488056821870672536L;

    /**
     * 操作
     */
    private List<OperationsPojo> operations;

    /**
     * 业务规则的条件
     */
    private List<FilterConditionsPoJo> filterConditionList;

    /**
     * 目标表单
     */
    private RuleTargetPojo target;

    /**
     * @see RuleVersionEnum
     */
    private Integer type;

    /**
     * "operationType": 1, //操作方式，可以通过枚举处理，仅更新数据
     */
    private Integer operationType;

    /**
     * 目标表单的数据
     */
    private List<PaasFormDataEntityExt> formDataList;

    /**
     * 本表单业务类型
     */
    private Integer businessType;

    /**
     * 本表单的saas标识
     */
    private Integer saasMark;

    private Long formId;

    /**
     * 本表单的数据
     */
    private PaasFormDataEntity paasFormDataEntity;

    private Map<String, FieldAttrEntity> targetExplain;

    private Map<String, FieldAttrEntity> thisExplain;
    /**
     * 最终要更新的字段
     */
    private List<UpdateDataEntity> updateList;
    /**
     * 主表搜索条件
     */
    private List<ConditionsEntityExt> conditionList;
    /**
     * 子表单搜索条件
     */
    private List<ConditionsEntityExt> subConditionList;
    /**
     * 目标表单的子表单的attr
     */
    private String attr;

    private List<List<ConditionsEntityExt>> shouldConditionList;


    /**
     * 关联数据的数据集合
     */
    private Map<String, PaasFormDataEntityExt> formDataMap;


    private Long dataId;

    private Long businessRuleInfoId;

    private Integer businessRuleType;

    public OperationDTO() {
    }


}
